Skip to content

test(vm_disk): cover non-default tiering_priority_factor (regression coverage for #30) - #377

Open
ddemlow wants to merge 1 commit into
mainfrom
test/vm-disk-tiering-priority-30
Open

test(vm_disk): cover non-default tiering_priority_factor (regression coverage for #30)#377
ddemlow wants to merge 1 commit into
mainfrom
test/vm-disk-tiering-priority-30

Conversation

@ddemlow

@ddemlow ddemlow commented Aug 7, 2026

Copy link
Copy Markdown
Member

Adds integration coverage for a non-default tiering_priority_factor, closing the gap that let #30 go undetected for ~4 years.

Why

Every pre-existing tiering_priority_factor assertion in tests/integration/targets/vm_disk/tasks/main.yml checks the default value — == 4, in all 8 places it appears — and nothing in the target ever sets a non-default value.

That means the suite could not observe #30 in either direction. The bug ("HyperCore ignores tieringPriorityFactor on disk create and forces the default, so it takes two passes") existed, sat for years, was fixed upstream, and vm_disk reported pass throughout.

#30 has now been verified fixed on HyperCore 9.7.7.226383 and closed. This adds the coverage so a re-regression is caught.

What it covers

  1. A non-default factor supplied at disk-creation time lands on the first pass — the exact vm_disk does not change tiering_priority on first run #30 symptom.
  2. It persists (confirmed via vm_info).
  3. Repeating the identical task is idempotent (changed=false) — the original bug made it non-idempotent.
  4. Changing the factor on an existing disk takes effect.

The VM has no disks at the point this runs, so the block creates its own disk and force-removes it afterwards — no new VM, and no interference with the existing assertions.

One implementation note worth reviewing

The assertion in (4) uses retries/until rather than a bare assert. On 9.7.7, changing tiering on an existing disk is accepted but not visible to a GET for a few seconds — the module returns changed=true while its own returned record, and vm_info, still carry the old factor. It settles well within 60s.

This is not a missing wait in the collection: ManageVMDisks._update_block_device already calls TaskTag.wait_task (plugins/module_utils/vm.py:1286), and HyperCore reports the task COMPLETE before the new value is readable — so it looks like eventual consistency on the HyperCore side.

A bare assert immediately after the change fails intermittently; that is what the retry is there for, and there is a comment in the test explaining it. Flagging it explicitly in case you would rather track that lag separately.

Verification

Ran against HyperCore 9.7.7.226383 (4-node cluster), ansible-core 2.16.19:

ansible-test integration --local vm_disk
testhost : ok=70  changed=15  unreachable=0  failed=0  skipped=0  rescued=0  ignored=0

Passes, no failures. Runtime goes from ~108s to ~149s (+41s), most of which is the settle poll in (4).

Notes

  • Test-only change; no changelogs/fragments/ entry added, since no existing fragment covers a test-only change and this has no user-facing effect. Happy to add one if you would prefer.
  • Integration tests do not run on pull requests (integ-test.yml is schedule + workflow_dispatch only), so this will not be exercised by PR CI — it was verified locally as above, and will be picked up by the nightly run once merged.

Every pre-existing tiering_priority_factor assertion in this target checks
the DEFAULT (4), in all 8 places, so none of them could detect the #30
behaviour: HyperCore ignoring tieringPriorityFactor on disk CREATE and
forcing the default, requiring a second pass (internal Scale REST 5143).

Adds coverage that a non-default factor lands on the FIRST pass, that a
repeat is idempotent, and that changing it on an existing disk takes effect.

Verified passing against HyperCore 9.7.7.226383 - the create-path bug is
fixed upstream; the collection never carried a workaround.

The change-path assertion uses retries because on 9.7.7 a GET immediately
after the change still returns the OLD factor for a few seconds, even though
_update_block_device already waits on the TaskTag and HyperCore reports it
COMPLETE. That read-after-write lag is distinct from #30.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant